package com.fun;

import org.jasypt.util.text.BasicTextEncryptor;

public class MainClass {
    public static void main(String[] args) {
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        //加密所需的salt(盐)
        encryptor.setPassword("password");
        //要加密的数据（数据库的用户名或密码）
        String username = encryptor.encrypt("root");
        String password = encryptor.encrypt("root123");
        System.out.println("username:"+username);
        System.out.println("password:"+password);


        System.out.println(encryptor.decrypt(username));
        System.out.println(encryptor.encrypt("123456"));
    }
}
